package com.example.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.entity.Major;
import com.example.repository.MajorRepository;
@Service
public class MajorService {
	
	@Autowired
	private MajorRepository  majorRepository;
	
	public List<Major> getMajor(){
		
		return (List<Major>) majorRepository.findAll();
	}
	
	public Major getID(String name){
		return majorRepository.getMajor(name);
	}
//	public void setMajor(Integer id){
//		majorRepository.save(id);
//		
//	}
	
}
